package com.example.photo.model.VO;

import com.example.photo.model.domain.Work;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;

/**
 * 作品打分信息对象
 *
 * @author Lwh
 * @time 2023/04/09 17:10
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ScoreWorkVO {
    //作品id
    private Integer workId;

    //封面文件
    private String coverFile;

    //作品文件
    private String workFile;

    //作品名
    private String workTitle;

    //作者id
    private Integer makerId;

    private String makerName;

    private String makerAvatar;

    //所属组
    private Integer contestGroup;

    //所属赛事id
    private Integer contestId;

    //作品描述
    private String description;

    //所获奖项
    private Integer prizeId;

    private String prizeName;

    //是否过审
    private Integer isPass;

    //浏览量
    private Integer views;

    //均分
    private BigDecimal average;

    //打分人数
    private Integer scorerNum;

    public ScoreWorkVO(Work work) {
        this.workId = work.getWorkId();
        this.coverFile = work.getCoverFile();
        this.workFile = work.getWorkFile();
        this.workTitle = work.getWorkTitle();
        this.makerId = work.getMakerId();
        this.contestGroup = work.getContestGroup();
        this.contestId = work.getContestId();
        this.description = work.getDescription();
        this.prizeId = work.getPrizeId();
        this.isPass = work.getIsPass();
        this.views = work.getViews();
        this.average = work.getAverage();
        this.scorerNum = work.getScorerNum();
    }
}
